home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9662 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  62 lines

  1. Path: dildog.lgc.com!not-for-mail
  2. From: mrovak@lgc.com (Mike.Rovak)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: borland c 4.5
  5. Date: 12 Mar 1996 10:52:28 -0600
  6. Organization: tulsa.lgc.com
  7. Message-ID: <4i4a4c$8fq@tulsa.lgc.com>
  8. References: <4h9u5k$ecj@rzsun02.rrz.uni-hamburg.de> <4i0gf9$4l0@mirv.unsw.edu.au>
  9. NNTP-Posting-Host: aris.tulsa.lgc.com
  10.  
  11. In article <4i0gf9$4l0@mirv.unsw.edu.au>,
  12. John Natschev <j.natschev@unsw.edu.au> wrote:
  13. >mleusch@rzdspc1.informatik.uni-hamburg.de (Michael Leuschner) wrote:
  14. >
  15. >
  16. >>We have a problem concerning Borland C++ 4.5 and hope somebody will be able to
  17. >>help us...
  18. >
  19. >>We developed a program in C++ with the IDE enviroment and the App Expert and
  20. >>have no problem with that. Now we want to add some C source code but were
  21. >>not successful. It seems that the c++ compiler is able to compile our
  22. >>ANSI c sources but later the linker can't manage to link the mix of
  23. >>c++ and c together...
  24. >
  25. >>Does anyone have a clue?
  26. >>Is the a known problem (and how can you solve it) ?
  27. >
  28. >>--Michael
  29. >>University of Hamburg, Germany
  30. >
  31. >i would say name mangling also.
  32. >the borland c 4.5 programmers guide suggests ways to solve this
  33. >problem.  can't remember which page.
  34. >John Natschev
  35. >Library Systems
  36. >University of New South Wales
  37. >
  38.  
  39. You must turn off name-mangling for references to your C functions in
  40. the C++ source. I'm not sure about the syntax in Borland C++, but for
  41. Microsoft it goes like this:
  42.  
  43. // mysource.cpp
  44.  
  45. extern "C" {
  46. C-function-prototype;
  47. C-function-prototype;
  48. }
  49.  
  50. You get the idea. Then, the linker should be able to resolve the
  51. references.
  52.  
  53. -- Mike
  54.  
  55. ------------------------------------------------------------------------
  56. Disclaimer: My opinions do not necessarily reflect those of my employer.
  57. ========================================================================
  58. ------------------------------------------------------------------------
  59.      mrovak@tulsa.lgc.com     
  60.  
  61. ========================================================================
  62.